export default {
	namespaced: true,
	state() {
		return {
			address: uni.setStorageSync('address') || {},
			token: ''
		}
	},
	mutations: {
		setAddress(state, address) {
			state.address = address
			this.commit('m_user/seveAddressToStorage')
		},
		// 数据持久化处理
		seveAddressToStorage(state) {
			uni.setStorageSync('address', state.address)
		}
	},
	getters: {
		addressStr(state) {
			return state.address.provinceName + ' ' + state.address.cityName + ' ' + state.address.countyName + ' ' +
				state
				.address.detailInfo
		}
	}
}